﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;

namespace WPF.DEMO.Pages
{
    /// <summary>
    /// PanelChildrenTransitionsPage.xaml 的交互逻辑
    /// </summary>
    public partial class PanelChildrenTransitionsPage : Page
    {
        public PanelChildrenTransitionsPage()
        {
            InitializeComponent();
        }

        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            panel.LayoutAnimation(delegate
            {
                var c1 = panel.Children[1];

                panel.Children.RemoveAt(1);
                panel.Children.Add(c1);
            });
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            panel.LayoutAnimation(delegate
            {
                btntest.Width = new Random().Next(100, 400);
            });


        }


        private void Button_Click_2(object sender, RoutedEventArgs e)
        {

            panel.LayoutAnimation(delegate
            {
                panel.Width = new Random().Next(100, 700);
            });
        }
    }
}
